package com.ruoyi.course.service.impl;

import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.CourseTrainSectionMapper;
import com.ruoyi.course.domain.CourseTrainSection;
import com.ruoyi.course.service.ICourseTrainSectionService;

/**
 * 培训课程章节表Service业务层处理
 *
 * @author zzx
 * @date 2023-03-29
 */
@Service
public class CourseTrainSectionServiceImpl implements ICourseTrainSectionService {
    @Autowired
    private CourseTrainSectionMapper courseTrainSectionMapper;

    /**
     * 查询培训课程章节表
     *
     * @param id 培训课程章节表主键
     * @return 培训课程章节表
     */
    @Override
    public CourseTrainSection selectCourseTrainSectionById(Long id) {
        return courseTrainSectionMapper.selectCourseTrainSectionById(id);
    }

    /**
     * 查询培训课程章节表列表
     *
     * @param courseTrainSection 培训课程章节表
     * @return 培训课程章节表
     */
    @Override
    public List<CourseTrainSection> selectCourseTrainSectionList(CourseTrainSection courseTrainSection) {
        return courseTrainSectionMapper.selectCourseTrainSectionList(courseTrainSection);
    }

    /**
     * 新增培训课程章节表
     *
     * @param courseTrainSection 培训课程章节表
     * @return 结果
     */
    @Override
    public int insertCourseTrainSection(CourseTrainSection courseTrainSection) {
                courseTrainSection.setCreateTime(DateUtils.getNowDate());
            return courseTrainSectionMapper.insertCourseTrainSection(courseTrainSection);
    }

    /**
     * 修改培训课程章节表
     *
     * @param courseTrainSection 培训课程章节表
     * @return 结果
     */
    @Override
    public int updateCourseTrainSection(CourseTrainSection courseTrainSection) {
        return courseTrainSectionMapper.updateCourseTrainSection(courseTrainSection);
    }

    /**
     * 批量删除培训课程章节表
     *
     * @param ids 需要删除的培训课程章节表主键
     * @return 结果
     */
    @Override
    public int deleteCourseTrainSectionByIds(Long[] ids) {
        return courseTrainSectionMapper.deleteCourseTrainSectionByIds(ids);
    }

    /**
     * 删除培训课程章节表信息
     *
     * @param id 培训课程章节表主键
     * @return 结果
     */
    @Override
    public int deleteCourseTrainSectionById(Long id) {
        return courseTrainSectionMapper.deleteCourseTrainSectionById(id);
    }
}
